package net.starwifi.duobao.entity;

import com.fasterxml.jackson.annotation.JsonProperty;

import javax.persistence.*;

/**
 * Created by Administrator on 2015/11/20.
 */
@Entity
@Table(name = "duob_db_code")
@SequenceGenerator(name = "sequenceGenerator", sequenceName = "duob_db_code_sequence")
public class DBCode extends BaseEntity{

    private static final long serialVersionUID = -2489707888966667035L;

    /** 夺宝号 */
    private Integer dbCode;

    /** 所属夺宝期 */
    private String timesNo;

    /** 夺宝所属订单 */
    private DBOrder dbOrder;

    private Long memberId;

    @JsonProperty
    @JoinColumn
    @Column
    public Integer getDbCode() {
        return dbCode;
    }

    public void setDbCode(Integer dbCode) {
        this.dbCode = dbCode;
    }

    @JoinColumn
    @Column
    public String getTimesNo() {
        return timesNo;
    }

    public void setTimesNo(String timesNo) {
        this.timesNo = timesNo;
    }

    @ManyToOne
    @JoinColumn(name = "order_id", nullable = false, updatable = false)
    public DBOrder getDbOrder() {
        return dbOrder;
    }

    public void setDbOrder(DBOrder dbOrder) {
        this.dbOrder = dbOrder;
    }


    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }
}
